﻿<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="Cursos.aspx.cs" Inherits="_Cursos" %>
<%@ Register assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    #tabela 
    {
       font: 18px tahoma, arial;
    }
    .dados
    {
        }
    .descricao 
    {
        width: 345px;
    }
    select, textarea
    {
        padding: 2px;
        font: 12px tahoma, arial;
    }
    .nome 
    {
        text-align:right;
        font: bold 30px Tahoma, Arial;
        color: #006C91;
    }

    img 
    {
        border: none;
    }

    input[type=text], input[type=password], textarea
    {
        padding: 5px;
    }
    #tabela0 
    {
       font: 18px tahoma, arial;
    }
    </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<%--<script type="text/javascript">muda(cursos, '#0C5C7E');</script>--%>

<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css" TabSpacing="3px" ImageFolder="~/App_Themes/Aqua/{0}/" LoadingPanelText="" Width="470px">
    <ContentStyle>
        <Border BorderColor="#AECAF0" BorderStyle="Solid" BorderWidth="1px" />
    </ContentStyle>
    <TabPages>
        <dx:TabPage Text="Cadastro de Cursos">
        <ContentCollection>
        <dx:ContentControl ID="ContentControl1" runat="server">

    <table style="width:474px; margin-top:10px;" cellpadding="0" cellspacing="4" id="tabela">
<tr>
    <td colspan="2" class="nome">Qualificações</td>
</tr>
<tr>
    <td class="dados" colspan="2">
        &nbsp;</td>
</tr>
<tr>
    <td class="dados">Curso:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtCurso" runat="server" MaxLength="100" Width="310px" 
            ValidationGroup="gInserir"></asp:TextBox>
    </td>
</tr>
<tr>
    <td class="dados">Descrição:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtDescricao" runat="server" MaxLength="100" Width="310px" 
            Rows="5" TextMode="MultiLine" ValidationGroup="gInserir"></asp:TextBox>
    </td>
</tr>
<tr>
    <td class="dados">Descrição parcial:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtDescricaoParcial" runat="server" MaxLength="100" 
            Width="310px" Rows="3" TextMode="MultiLine" ValidationGroup="gInserir"></asp:TextBox>
    </td>
</tr>    
<tr>
    <td class="dados">Passaporte formativo:</td>
    <td align="left" class="descricao">
    <asp:DropDownList ID="ddCodCategoria" runat="server" AppendDataBoundItems="True" 
        DataSourceID="dsCategorias" DataTextField="Categoria" DataValueField="CodCategoria" 
        EnableViewState="False" ValidationGroup="gInserir">
        <asp:ListItem></asp:ListItem>
    </asp:DropDownList>
    </td>
</tr>    
<tr>
    <td class="dados">Carga horária:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtCH" runat="server" MaxLength="3" Width="40px" 
            ValidationGroup="gInserir"></asp:TextBox>
    </td>
</tr>    
        <tr><td colspan="2" style="height:10px;">
            <asp:Label ID="lblMensagem" runat="server" EnableViewState="False" 
                ForeColor="Red"></asp:Label>
            </td></tr>
        <tr><td colspan="2" style="height:10px;" align="right">
            
                        <asp:RequiredFieldValidator ID="RV1" runat="server" 
                ControlToValidate="txtCurso" Display="None" ErrorMessage="Informe o curso" 
                ValidationGroup="gInserir"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV2" runat="server" 
                ControlToValidate="txtDescricao" Display="None" 
                ErrorMessage="Informe a descrição" ValidationGroup="gInserir"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV3" runat="server" 
                ControlToValidate="txtDescricaoParcial" Display="None" 
                ErrorMessage="Informe a descrição parcial" ValidationGroup="gInserir"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV4" runat="server" 
                ControlToValidate="ddCodCategoria" Display="None" 
                ErrorMessage="Informe a categoria" ValidationGroup="gInserir"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV5" runat="server" ControlToValidate="txtCH" 
                Display="None" ErrorMessage="Informe a carga horária" 
                ValidationGroup="gInserir"></asp:RequiredFieldValidator>
            <asp:CompareValidator ID="CV1" runat="server" ControlToValidate="txtCH" 
                Display="None" 
                ErrorMessage="A carga horária deve ser preenchida apenas com números" 
                Operator="DataTypeCheck" Type="Integer" ValidationGroup="gInserir"></asp:CompareValidator>
            <asp:ValidationSummary ID="VS1" runat="server" ShowMessageBox="True" 
                ShowSummary="False" ValidationGroup="gInserir" />
            <asp:ImageButton ID="btnInserir" runat="server" 
                ImageUrl="../figuras/bInserir.gif" 
                onclick="btnInserir_Click" ValidationGroup="gInserir" />

            
            
            </td></tr>
        </table>
        </dx:ContentControl>
        </ContentCollection>
    </dx:TabPage>
    <dx:TabPage Text="Alterar curso">
        <ContentCollection>
        <dx:ContentControl ID="ContentControl2" runat="server">

    <table style="width:474px; margin-top:10px;" cellpadding="0" cellspacing="4" 
        id="tabela0">
<tr>
    <td class="dados" colspan="2">
        Selecione abaixo o curso que deseja alterar:</td>
</tr>
<tr>
    <td class="dados" colspan="2">
        <asp:DropDownList ID="ddCursosCadastrados" runat="server" 
            AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="dsCursos" 
            DataTextField="Curso" DataValueField="CodCurso" 
            onselectedindexchanged="ddCursosCadastrados_SelectedIndexChanged">
            <asp:ListItem></asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="dsCursos" runat="server" 
            ConnectionString="<%$ ConnectionStrings:conexao_intranet_ler %>" 
            ProviderName="<%$ ConnectionStrings:conexao_intranet_ler.ProviderName %>" SelectCommand="Select CodCurso, Curso
From CamaraCursos
Order By Curso"></asp:SqlDataSource>
    </td>
</tr>
<tr>
    <td class="dados">Curso:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtCursoAlterar" runat="server" MaxLength="100" Width="310px" 
            ValidationGroup="gAlterar"></asp:TextBox>
    </td>
</tr>
<tr>
    <td class="dados">Descrição:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtDescricaoAlterar" runat="server" MaxLength="100" Width="310px" 
            Rows="5" TextMode="MultiLine" ValidationGroup="gAlterar"></asp:TextBox>
    </td>
</tr>
<tr>
    <td class="dados">Descrição parcial:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtDescricaoParcialAlterar" runat="server" MaxLength="100" 
            Width="310px" Rows="3" TextMode="MultiLine" ValidationGroup="gAlterar"></asp:TextBox>
    </td>
</tr>    
<tr>
    <td class="dados">Categoria:</td>
    <td align="left" class="descricao">
    <asp:DropDownList ID="ddCodCategoriaAlterar" runat="server" AppendDataBoundItems="True" 
        DataSourceID="dsCategorias" DataTextField="Categoria" DataValueField="CodCategoria" 
        EnableViewState="False" ValidationGroup="gAlterar">
        <asp:ListItem></asp:ListItem>
    </asp:DropDownList>
    </td>
</tr>    
<tr>
    <td class="dados">Carga horária:</td>
    <td align="left" class="descricao">
        <asp:TextBox ID="txtCHAlterar" runat="server" MaxLength="3" Width="40px" 
            ValidationGroup="gAlterar"></asp:TextBox>
    </td>
</tr>    
        <tr><td colspan="2" style="height:10px;">
            <asp:Label ID="lblMensagemAlterar" runat="server" EnableViewState="False" 
                ForeColor="Red"></asp:Label>
            </td></tr>
        <tr><td colspan="2" style="height:10px;" align="right">
            
                        <asp:RequiredFieldValidator ID="RV6" runat="server" 
                ControlToValidate="txtCursoAlterar" Display="None" ErrorMessage="Informe o curso" 
                ValidationGroup="gAlterar"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV7" runat="server" 
                ControlToValidate="txtDescricaoAlterar" Display="None" 
                ErrorMessage="Informe a descrição" ValidationGroup="gAlterar"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV8" runat="server" 
                ControlToValidate="txtDescricaoParcialAlterar" Display="None" 
                ErrorMessage="Informe a descrição parcial" ValidationGroup="gAlterar"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV9" runat="server" 
                ControlToValidate="ddCodCategoriaAlterar" Display="None" 
                ErrorMessage="Informe a categoria" ValidationGroup="gAlterar"></asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RV10" runat="server" ControlToValidate="txtCHAlterar" 
                Display="None" ErrorMessage="Informe a carga horária" 
                ValidationGroup="gAlterar"></asp:RequiredFieldValidator>
            <asp:CompareValidator ID="CV2" runat="server" ControlToValidate="txtCHAlterar" 
                Display="None" 
                ErrorMessage="A carga horária deve ser preenchida apenas com números" 
                Operator="DataTypeCheck" Type="Integer" ValidationGroup="gAlterar"></asp:CompareValidator>
            <asp:ValidationSummary ID="VS2" runat="server" ShowMessageBox="True" 
                ShowSummary="False" ValidationGroup="gAlterar" />
            <asp:ImageButton ID="btnAlterar" runat="server" 
                ImageUrl="../figuras/bAlterar.gif" 
                onclick="btnAlterar_Click" ValidationGroup="gAlterar" />

            
            
            </td></tr>
        </table>


                    </dx:ContentControl>
                </ContentCollection>
            </dx:TabPage>
            </TabPages>
        <Paddings Padding="2px" PaddingLeft="5px" PaddingRight="5px" />
    </dx:ASPxPageControl>
        <asp:SqlDataSource ID="dsCategorias" runat="server" 
        ConnectionString="<%$ ConnectionStrings:conexao_intranet_ler %>" 
        ProviderName="<%$ ConnectionStrings:conexao_intranet_ler.ProviderName %>" SelectCommand="SELECT * FROM CamaraCategorias ORDER BY Categoria">
        </asp:SqlDataSource>

    </asp:Content>

